﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Deixei;

using Deixei.Infrastructure;
using Deixei.Web;
using Deixei.Web.Filters;
using Deixei.Domain;
using Microsoft.Practices.Unity;
using Deixei.WebApplication.Controllers;
using Deixei.WebApplication.Areas.MarcioParente.Controllers;
using Deixei.WebApplication.Areas.Sales.Controllers;
using Deixei.Web.Controllers;
using Deixei.WebApplication.Api;
using Deixei.Domain.Service;
using Deixei.WebApplication.Areas.Admin.Controllers;
using Deixei.WebApplication.Areas.CustomerService.Controllers;
using Deixei.WebApplication.Areas.Demos.Controllers;
using Deixei.WebApplication.Areas.Marketing.Controllers;
//using System.Web.Http.Data;

namespace Deixei.WebApplication
{

    public class MvcApplication : DeixeiHttpApplication
    {
        protected void Application_Start()
        {
            base.Initialise();

            DeixeiContainer.Container.RegisterType<DeixeiController, HomeController>("Home");
            DeixeiContainer.Container.RegisterType<DeixeiController, AccountController>("Account");

            DeixeiContainer.Container.RegisterType<DeixeiController, CVController>("CV");

            DeixeiContainer.Container.RegisterType<PortfolioController, PortfolioController>("Portfolio");

            DeixeiContainer.Container.RegisterType<AccountsController, AccountsController>("Accounts");
            DeixeiContainer.Container.RegisterType<CasesController, CasesController>("Cases");
            DeixeiContainer.Container.RegisterType<ContractsController, ContractsController>("Contracts");
            DeixeiContainer.Container.RegisterType<KnowledgeController, KnowledgeController>("Knowledge");
            DeixeiContainer.Container.RegisterType<SchedulingController, SchedulingController>("Scheduling");
            DeixeiContainer.Container.RegisterType<BootstrapController, BootstrapController>("Bootstrap");
            DeixeiContainer.Container.RegisterType<DataController, DataController>("Data");
            DeixeiContainer.Container.RegisterType<SegmentationController, SegmentationController>("Segmentation");
            DeixeiContainer.Container.RegisterType<CustomerController, CustomerController>("Customer");
            DeixeiContainer.Container.RegisterType<LeadsController, LeadsController>("Leads");
            DeixeiContainer.Container.RegisterType<OpportunitiesController, OpportunitiesController>("Opportunities");
            DeixeiContainer.Container.RegisterType<PipelineController, PipelineController>("Pipeline");
            DeixeiContainer.Container.RegisterType<PlanningController, PlanningController>("Planning");
            DeixeiContainer.Container.RegisterType<TimesaversController, TimesaversController>("Timesavers");


            //DeixeiContainer.Container.RegisterType<ApiController, CustomerServiceController>("CustomerService");

            

            //var factory = new UnityControllerFactory(DeixeiContainer.Container);
            //ControllerBuilder.Current.SetControllerFactory(factory);
        }


    }
}